<?php
$http = new swoole_http_server("0.0.0.0",8811);
//设置静态资源存放的一些配置
$http->set([
    'enable_static_handler' => true,
    'document_root' => '/home/vagrant/Code/demo/data'
]);
$http->on("request",function ($request,$response){
//    print_r($request->get);
    $response->cookie('test',666,time()+1800);
    $response->end("<h1>HTTP SERVER</h1>" .PHP_EOL. json_encode($request->get));
});
$http->start();